import {useState} from 'react'
function Dog() {
    //let a = false;
    let [isBarking, setisBarking] = useState(false)
    let [isRunning, setisRunning] = useState(false)
    const  handleClick = () =>{
        // DOM 编程已经一去不复返了
       setisBarking(true)
       setisRunning(true)
       setTimeout(()=> {
        setisBarking(false)
        setisRunning(false)
       },2000)
       //a = true;
    }
    return (
        // 动态 多个动态
        <div onClick={handleClick}>
            <div>lwb is a Dog</div>
            <p>{isBarking && '汪汪汪'}</p>
            <p>{isRunning && 'runrunrun'}</p>
        </div>
    )
}
export default Dog